package git.soulbgm.pojo;

import java.util.Objects;

/**
 * 地图的坐标(经纬度)
 *
 * @author SoulBGM
 * @date 2022/10/18 09:47
 */
public class MapPoint {

    /**
     * 经度
     */
    private double lng;

    /**
     * 纬度
     */
    private double lat;

    public MapPoint() {
    }

    public MapPoint(double lng, double lat) {
        this.lng = lng;
        this.lat = lat;
    }

    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MapPoint)) {
            return false;
        }
        MapPoint mapPoint = (MapPoint) o;
        return Double.compare(mapPoint.lng, lng) == 0 && Double.compare(mapPoint.lat, lat) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(lng, lat);
    }
}
